<?php

include_once("../commonFunctions.php");

class Store {

    var $id;
    var $market;
    var $state;
    var $storeName;
    var $storeAbbrev;

    function __construct($storeAb) {
        $query = "select * from stores where storeAbbrev='" . $storeAb . "';";
        $result = mysql_query($query) or die("query failed in Store.php");
        if (mysql_num_rows($result) > 0) {
            $row = mysql_fetch_array($result, MYSQL_ASSOC);
            $this->id = $row['id'];
            $this->market = $row['market'];
            $this->state = $row['state'];
            $this->storeName = $row['storeName'];
            $this->storeAbbrev = $row['storeAbbrev'];
        } else {
            return null; // Store doesn't exist
        }
    }

}

?>
